<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>指令</title>
    <style>
        [v-cloak] {
            display: none;
        }
    </style>
</head>

<body>
    <div id="app">
        <p ref="content">尚硅谷</p>
        <button @click="hint">提示</button>
        <p v-cloak>{{msg}}</p>
    </div>
    <script src="https://cdn.bootcss.com/vue/2.5.16/vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                msg: 'atguigu'
            },
            methods: {
                hint() {
                    // console.log(this.$refs.content);
                    alert(this.$refs.content.innerHTML)
                }
            }
        })
    </script>
</body>

</html>